package com.itmuch.cloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.stereotype.Component;



/*
 * Feign对hystrix的支持
 *    1.创建一个类HystrixClientFallback实现UsedrFeignClient接口
 * 	  2.在接口UsedrFeignClient添加注解fallback=HystrixClientFallback.class
 *    3.实现类添加注解@Component
 *    4.启动eureka,user服务提供者，本项目
 *    5.浏览地址为http://localhost:7900/movie/1，http://localhost:7900/health
 *    6.停止user服务提供者，不断点击http://localhost:7900/movie/1，直到浏览器没有转圈访问，
 *    7.最后点击http://localhost:7900/health，状态发生改变
 *    
 * */

@EnableCircuitBreaker
@EnableEurekaClient
@SpringBootApplication
@EnableFeignClients
public class ConsumeFeignwithHystrixApplication {
	public static void main(String[] args) {
		SpringApplication.run(ConsumeFeignwithHystrixApplication.class, args);
	}
}
